<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>管理页面</title></html>

<script>
    function displayUserManager() {
        var div = document.getElementById("userManager");
        if (div.style.display=="none"){
            div.style.display = "block"
        }else if (div.style.display == "block"){
            div.style.display = "none"
        }
    }
    function displayLogout() {
        var div = document.getElementById("logout");
        if (div.style.display=="none"){
            div.style.display = "block"
        }else if (div.style.display == "block"){
            div.style.display = "none"
        }
    }
    function toIndex() {
        var mainContent = parent.window.document.getElementById('mainContent');
        mainContent.src = "http://localhost:8080/listUserHomeServlet"
    }
    function toCart() {
        var mainContent = parent.window.document.getElementById('mainContent');
        mainContent.src = "http://localhost:8080/listCartServlet"
    }
    function toOrder(){
        var mainContent = parent.window.document.getElementById('mainContent');
        mainContent.src = "http://localhost:8080/listOrdersServlet"
    }
    function logout(){
        parent.window.location.href="http://localhost:8080/login.jsp";
    }
</script>
</head>
<body style="background: pink">
<div style="position: absolute;top: 5%;left: 27%;">
    <div>
        <input type="button" value="导航栏" onclick="displayUserManager()" style="width: 120px;height: 36px">
        <div id="userManager" style="display: none">
            <input type="button" value="首页" onclick="toIndex()" style="width: 120px;height: 36px;background: dodgerblue;">
            <input type="button" value="购物车" onclick="toCart()" style="width: 120px;height: 36px;background: dodgerblue;">
            <input type="button" value="我的订单" onclick="toOrder()" style="width: 120px;height: 36px;background: dodgerblue;">
        </div>
        <div/>
        <div>
            <input type="button" value="用户退出" onclick="displayLogout()" style="width: 120px;height: 36px">
            <div id="logout" style="display: none">
                <input type="button" value="确认退出" onclick="logout()" style="width: 120px;height: 36px;background: dodgerblue;">
            </div>
        </div>
    </div>
</div>
</body>
</html>
